<a href="/"><div class="topBack"><img src="/images/back_jiantou.png" style="width:40px;height:40px;"></div></a>
<div class="topContent">积分商城</div>
<div class="topRight">&nbsp;</div>
<div class="clear"></div>

<div id="wrapperCredit" class="wrapperComman" style="top:40px;bottom:0px;">
<div style="width:100%;">

<div style="width:20%;height:80px;float:left;text-align:center;padding-top:10px;"><img src="/images/credit.png" style="width:50px;height:50px;"></div>
<div style="width:50%;height:80px;float:left;padding:15px 0px;">
	<p style="color:grey;font-size:1.1em;">当前积分</p>
	<p style="font-size:0.8em;color:grey;"><span id="totalCredit" style="color:red;font-size:1.4em;font-weight:bolder;"><?php if(!empty($this->res_info->User)){echo $this->res_info->User->credit;}else{echo 0;}?></span>分</p>
</div>
<div onclick="javascript:showRole();return false;" style="width:30%;height:80px;float:left;padding-top:15px;color:#38B901;"><img src="/images/creditRole.png"><span style="padding-top:5px;padding-left:5px;">积分规则</span></div>
<div class="clear"></div>

<?php
	if(!empty($this->CreditRoleList)){
		echo '<div style="background-color:#F2F2F2;width:100%;padding-top:20px;">';
		foreach($this->CreditRoleList as $c){
			echo '
				<div style="width:92%;margin:0px auto;border-radius:4px;border:1px solid #ECECEC;">
					<table style="width:100%;">
						<tr>
							<td style="width:75%;background-color:white;">
								<div style="float:left;width:15%;text-align:center;color:red;font-size:1.9em;font-weight:bolder;">'.$c->gift.'</div>
								<div style="float:left;width:85%;color:#AAAAAA;font-size:0.9em;padding:5px 0px;">
									<p>元【'.$c->gift_title.'】</p>
									<p>满'.$c->gift_limit.'元可用</p>
								</div>
								<div class="clear"></div>
								<div style="padding:0px 0px 5px 10px;color:#AAAAAA;font-size:0.9em;">兑换截止：'.substr($c->expired,0,10).'</div>
							</td>
							<td giftId="'.$c->id.'" giftCredit="'.$c->gift_credit.'" gift="'.$c->gift.'" giftTitle="'.$c->gift_title.'" giftLimit="'.$c->gift_limit.'" giftStartTime="'.$c->gift_starttime.'" giftExpired="'.$c->gift_expired.'" onclick="javascript:creditConsume(this);return false;" style="width:25%;background-color:#EC2829;text-align:center;color:white;">
								<p>兑换</p>
								<p style="font-size:0.8em;">扣'.$c->gift_credit.'积分</p>
							</td>
						</tr>
					</table>
				</div>
				<div class="clear" style="height:20px;">&nbsp;</div>
			';
		}		
		echo '</div>';
	}else{
		echo '
			<div style="text-align:center;"><img src="/images/none.jpg" style="width:50%;padding-top:110px;"></div>
			<div style="padding:10px;text-align:center;">
					积分商城暂无商品，敬请期待！</div>';
	}
 ?>
<div id="voucherRole" style="padding:10px;font-size:0.9em;border:1px dashed #37B800;width:96%;margin:0px auto;margin-top:2%;">
	<p style="font-size:1.1em;color:black;">积分规则：</p>
	<p><span style="">1、</span>用户在鲜店完成订单后，每消费1元积1分，如消费30.9元，积30分，小数部分不计。</p>
	<p><span style="">2、</span>积分只适用于完成订单，下单后取消或下单未成功将不享有此福利。</p>
	<p><span style="">3、</span>如订单产生退货，积分将不能享有。</p>
	<p><span style="">4、</span>完成订单后，积分将于2天内自动累计到下单账户，登陆鲜店微信，进入“我的”即可查看 。</p>
	<p><span style="">5、</span>用户积分可兑换相应的奖品、参加用户积分系列活动（具体奖品以活动为主）。</p>
	<p><span style="">6、</span>用户积分不找零、不挂失、不退换、不兑现。</p>
	<p><span style="">7、</span>鲜店拥有对积分活动的最终解释权。</p>
</div>
<br><br>
</div>
</div>
<script type="text/javascript">
	var myscroll='';
	$(document).ready(function() {
        function loaded(){
           setTimeout(function(){
                    myscroll=new iScroll("wrapperCredit");
             },100 );
        }
		loaded();
	});
	function showRole(){
		var height = $('#voucherRole').position().top;
		myscroll.scrollTo(0,height,300,true);
	}
</script>